#ifndef REGISTERMODULE_H
#define REGISTERMODULE_H

#include "RegisterHandler.h"

#include "resip/stack/NameAddr.hxx"
#include "resip/stack/SipStack.hxx"
#include "resip/stack/SipMessage.hxx"
#include "resip/dum/DialogUsageManager.hxx"

#define BASEPORT 5060
#define DESTPORT 5070
#define SELECT_TIME 100
#define REG_TIME 70


class RegisterModule
{
public:
	// Constructor & Destructor

	RegisterModule(resip::DialogUsageManager* dum, resip::SipStack *stack);
	virtual ~RegisterModule();

	// Memberfunctions

	void initialize();
	void cleanup();

	void waitForResponse();

	void setScheme(std::string scheme);
	void setBaseUser(std::string user);
	void setDestUser(std::string user);
	void setDestHost(std::string uri);
	void setDestPassword(std::string password);

	void sendRegisterMessage();

private:
	// Memberfunctions

	void initializeHandler();
	void initializeUsers();

	// Membervariables

	RegisterHandler* m_registerHandler;

	resip::DialogUsageManager* m_dialogUsageManager;
	resip::SipStack* m_stack;

	resip::NameAddr m_baseAor;
	resip::NameAddr m_destAor;

	std::string m_password;
};

#endif